import { getCartList } from "@/api"

export default{
  namespaced:true,
  state(){
    return {
      cartList:[]
    }
  },
  mutations:{
    setCartList(state,result){
      state.cartList=result
    }
  },
  actions:{
    // 获取购物车列表
    async getCartList({commit}){
      const result=await getCartList()
      commit('setCartList',result)
    }
  }
}